package controller.admin.setmeal;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import model.VO.SetmealByIdVO;
import service.Impl.SetmealServiceImpl;
import util.ResultUtil;

import java.io.IOException;

@WebServlet("/admin/setmeal/get")
public class SetmealByIdController extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int id= Integer.parseInt(req.getParameter("id"));
        SetmealServiceImpl ss=new SetmealServiceImpl();
        SetmealByIdVO sBV=ss.get(id);
        String json= ResultUtil.getJSON(sBV);
        resp.getWriter().println(json);
    }
}
